library(ggplot2)


###########################################RWP Vote Share###############################################

#Average Casual Mediation Effect ()
acme_vector <- c(  -.0116661 , -.0051667 , -.0006782)
#Direct Effect
direct_vector <- c(-.0541295, -.0329026 , -.0112216)
#Total Effect
toteff_vector <- c(-.0567823,-.0381249,-.0195789)


ests <- rbind(toteff_vector, direct_vector, acme_vector)
names <- c("lower", "point", "upper")
colnames(ests) <- names

ests <- as.data.frame(ests)
ests$model <- c("Total Effect", "Direct Effect", "ACME") #effect names var
ests

ggplot(ests2, aes(x=model, y=point, color = model)) +
  geom_point() +
  geom_hline(yintercept=0) +
  geom_pointrange(aes(ymin = lower, ymax = upper)) +
  labs(y="Estimated Effect", x="", title = "") +
  coord_flip() +
  theme_minimal() +
  theme(legend.position = "none") 

###########################################Remittances###############################################

#Average Casual Mediation Effect ()
acme_vector2 <- c(  -.0207304 , -.0093329  , -.0008229)
#Direct Effect
direct_vector2 <- c(-.0443992, -.0250242 , -.0047592)
#Total Effect
toteff_vector2 <- c(-.0460615,-.0343834,-.0207783)


ests2 <- rbind(toteff_vector2, direct_vector2,  acme_vector2)
names <- c("lower", "point", "upper")
colnames(ests2) <- names

ests2 <- as.data.frame(ests2)
ests2$model <- c("Total Effect", "Direct Effect", "ACME") #effect names var
ests2

ggplot(ests2, aes(x=model, y=point, color = model)) +
  geom_point() +
  geom_hline(yintercept=0) +
  geom_pointrange(aes(ymin = lower, ymax = upper)) +
  labs(y="Estimated Effect", x="", title = "") +
  coord_flip() +
  theme_minimal() +
  theme(legend.position = "none") 
